﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Trongkhoang" targetNamespace="http://tempuri.org/Trongkhoang.xsd" xmlns:mstns="http://tempuri.org/Trongkhoang.xsd" xmlns="http://tempuri.org/Trongkhoang.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="QuanLyNhaSachConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="QuanLyNhaSachConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.quanlynhasach.Properties.Settings.GlobalReference.Default.QuanLyNhaSachConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="HoaDonTableAdapter" GeneratorDataComponentClassName="HoaDonTableAdapter" Name="HoaDon" UserDataComponentName="HoaDonTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="QuanLyNhaSachConnectionString (Settings)" DbObjectName="QuanLyNhaSach.dbo.HoaDon" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>DELETE FROM [dbo].[HoaDon] WHERE (([MaHoaDon] = @Original_MaHoaDon) AND ([MaNhanVien] = @Original_MaNhanVien) AND ([TongTien] = @Original_TongTien) AND ([Ngay] = @Original_Ngay) AND ((@IsNull_MaKH = 1 AND [MaKH] IS NULL) OR ([MaKH] = @Original_MaKH)))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_MaHoaDon" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaHoaDon" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_MaNhanVien" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaNhanVien" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TongTien" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TongTien" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@Original_Ngay" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="0" SourceColumn="Ngay" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_MaKH" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="MaKH" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_MaKH" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaKH" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>INSERT INTO [dbo].[HoaDon] ([MaHoaDon], [MaNhanVien], [TongTien], [Ngay], [MaKH]) VALUES (@MaHoaDon, @MaNhanVien, @TongTien, @Ngay, @MaKH);
SELECT MaHoaDon, MaNhanVien, TongTien, Ngay, MaKH FROM HoaDon WHERE (MaHoaDon = @MaHoaDon)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MaHoaDon" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaHoaDon" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MaNhanVien" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaNhanVien" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@TongTien" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TongTien" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@Ngay" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="0" SourceColumn="Ngay" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MaKH" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaKH" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT MaHoaDon, MaNhanVien, TongTien, Ngay, MaKH FROM dbo.HoaDon where Ngay&gt;=@NGAY1 and Ngay &lt;= @NGAY2</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="NGAY1" ColumnName="Ngay" DataSourceName="QuanLyNhaSach.dbo.HoaDon" DataTypeServer="smalldatetime" DbType="DateTime" Direction="Input" ParameterName="@NGAY1" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="4" SourceColumn="Ngay" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="NGAY2" ColumnName="Ngay" DataSourceName="QuanLyNhaSach.dbo.HoaDon" DataTypeServer="smalldatetime" DbType="DateTime" Direction="Input" ParameterName="@NGAY2" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="4" SourceColumn="Ngay" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>UPDATE [dbo].[HoaDon] SET [MaHoaDon] = @MaHoaDon, [MaNhanVien] = @MaNhanVien, [TongTien] = @TongTien, [Ngay] = @Ngay, [MaKH] = @MaKH WHERE (([MaHoaDon] = @Original_MaHoaDon) AND ([MaNhanVien] = @Original_MaNhanVien) AND ([TongTien] = @Original_TongTien) AND ([Ngay] = @Original_Ngay) AND ((@IsNull_MaKH = 1 AND [MaKH] IS NULL) OR ([MaKH] = @Original_MaKH)));
SELECT MaHoaDon, MaNhanVien, TongTien, Ngay, MaKH FROM HoaDon WHERE (MaHoaDon = @MaHoaDon)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MaHoaDon" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaHoaDon" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MaNhanVien" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaNhanVien" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@TongTien" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TongTien" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@Ngay" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="0" SourceColumn="Ngay" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MaKH" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaKH" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_MaHoaDon" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaHoaDon" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_MaNhanVien" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaNhanVien" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TongTien" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TongTien" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@Original_Ngay" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="0" SourceColumn="Ngay" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_MaKH" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="MaKH" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_MaKH" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaKH" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="MaHoaDon" DataSetColumn="MaHoaDon" />
              <Mapping SourceColumn="MaNhanVien" DataSetColumn="MaNhanVien" />
              <Mapping SourceColumn="TongTien" DataSetColumn="TongTien" />
              <Mapping SourceColumn="Ngay" DataSetColumn="Ngay" />
              <Mapping SourceColumn="MaKH" DataSetColumn="MaKH" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="Trongkhoang" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="Trongkhoang" msprop:Generator_UserDSName="Trongkhoang">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="HoaDon" msprop:Generator_TableClassName="HoaDonDataTable" msprop:Generator_TableVarName="tableHoaDon" msprop:Generator_TablePropName="HoaDon" msprop:Generator_RowDeletingName="HoaDonRowDeleting" msprop:Generator_RowChangingName="HoaDonRowChanging" msprop:Generator_RowEvHandlerName="HoaDonRowChangeEventHandler" msprop:Generator_RowDeletedName="HoaDonRowDeleted" msprop:Generator_UserTableName="HoaDon" msprop:Generator_RowChangedName="HoaDonRowChanged" msprop:Generator_RowEvArgName="HoaDonRowChangeEvent" msprop:Generator_RowClassName="HoaDonRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="MaHoaDon" msprop:Generator_ColumnVarNameInTable="columnMaHoaDon" msprop:Generator_ColumnPropNameInRow="MaHoaDon" msprop:Generator_ColumnPropNameInTable="MaHoaDonColumn" msprop:Generator_UserColumnName="MaHoaDon">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="MaNhanVien" msprop:Generator_ColumnVarNameInTable="columnMaNhanVien" msprop:Generator_ColumnPropNameInRow="MaNhanVien" msprop:Generator_ColumnPropNameInTable="MaNhanVienColumn" msprop:Generator_UserColumnName="MaNhanVien">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="TongTien" msprop:Generator_ColumnVarNameInTable="columnTongTien" msprop:Generator_ColumnPropNameInRow="TongTien" msprop:Generator_ColumnPropNameInTable="TongTienColumn" msprop:Generator_UserColumnName="TongTien" type="xs:int" />
              <xs:element name="Ngay" msprop:Generator_ColumnVarNameInTable="columnNgay" msprop:Generator_ColumnPropNameInRow="Ngay" msprop:Generator_ColumnPropNameInTable="NgayColumn" msprop:Generator_UserColumnName="Ngay" type="xs:dateTime" />
              <xs:element name="MaKH" msprop:Generator_ColumnVarNameInTable="columnMaKH" msprop:Generator_ColumnPropNameInRow="MaKH" msprop:Generator_ColumnPropNameInTable="MaKHColumn" msprop:Generator_UserColumnName="MaKH" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:HoaDon" />
      <xs:field xpath="mstns:MaHoaDon" />
    </xs:unique>
  </xs:element>
</xs:schema>